{{ if not .Params.noauthor }}
{{ if or .Params.author .Site.Params.author}}
{{$authorname := or .Params.author .Site.Params.author }}
{{$authorbio := or .Params.authorbio .Site.Params.authorbio }}
{{$authorlocation := or .Params.authorlocation .Site.Params.authorlocation }}
{{$authorwebsite := or .Params.authorwebsite .Site.Params.authorwebsite }}
{{$authoravatar := or .Params.authoravatar .Site.Params.logo }}

{{with $authoravatar}}
<figure class="author-image">
    <a class="img" href="{{$.Site.BaseURL}}" style="background-image: url({{. | relURL}})"><span class="hidden">{{$authorname}}'s Picture</span></a>
</figure>
{{end}}

<section class="author">
  <h4><a href="{{.Site.BaseURL}}">{{$authorname}}</a></h4>
  {{if $authorbio}}
  <p>{{$authorbio}}</p>
  {{else}}
  <p>Read <a href="{{.Site.BaseURL}}">more posts</a> by this author.</p>
  {{end}}
  <div class="author-meta">
    {{with $authorlocation}}<span class="author-location icon-location">{{.}}</span>{{end}}
    {{with $authorwebsite}}<span class="author-link icon-link"><a href="{{.}}">{{.}}</a></span>{{end}}
  </div>
</section>
{{end}}
{{end}}
